package com.example.demo.mqserver.mapper;

import com.example.demo.mqserver.core.BasicProperties;
import com.example.demo.mqserver.core.Binding;
import com.example.demo.mqserver.core.Exchange;
import com.example.demo.mqserver.core.MSGQueue;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.javassist.bytecode.ExceptionsAttribute;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 张
 * Date: 2024-07-23
 * Time: 8:42
 */
@Mapper
public interface MetaMapper {
    //提供建表方法
    void createExchangeTable();
    void createQueueTable();
    void createBindingTable();

    //针对上述三个基本概念进行插入和删除
    void insertExchange(Exchange exchange);
    List<Exchange> selectAllExchanges();
    void deleteExchange(String exchangeName);
    void insertQueue(MSGQueue queue);
    List<MSGQueue> selectAllQueues();
    void deleteQueue(String queueName);
    void insertBinding(Binding binding);
    List<Binding> selectAllBindings();
    //binding由于没有主键,所以binding的删除操作针对exchangeName 和 queueName两个变量进行操作
    void deleteBinding(Binding binding);

}
